//
//  CQVBNavigationBar.m
//  CQPictureBrowser
//
//  Created by 陈长青 on 2017/3/30.
//  Copyright © 2017年 chenchangqing198@126.com. All rights reserved.
//

#import "CQVBNavigationBar.h"

@interface CQVBNavigationBar ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *downloadBtnW;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *zhuanfaBtnW;

@end

@implementation CQVBNavigationBar
@synthesize cell=_cell;

#pragma mark - 生命周期

- (instancetype)init {
    self = [super init];
    if (self) {
        
        _isShowDownloadBtn = NO;
        _isShowZhuanfaBtn = NO;
    }
    return self;
}

- (IBAction)close {
    
    if ([_delegate respondsToSelector:@selector(navigationBarClickedBack:)]) {
        [_delegate navigationBarClickedBack:self];
    }
}

- (IBAction)share:(id)sender {
    
    if ([_delegate respondsToSelector:@selector(navigationBarClickedShare:)]) {
        [_delegate navigationBarClickedShare:self];
    }
}

- (IBAction)download:(id)sender {
    
    if ([_delegate respondsToSelector:@selector(navigationBarClickedDownload:)]) {
        [_delegate navigationBarClickedDownload:self];
    }
}

- (IBAction)zhuanfa:(id)sender {
    
    if ([_delegate respondsToSelector:@selector(navigationBarClickedZhuanfa:)]) {
        [_delegate navigationBarClickedZhuanfa:self];
    }
}

- (void)setIsShowDownloadBtn:(BOOL)isShowDownloadBtn {
    _isShowDownloadBtn = isShowDownloadBtn;
    
    if (isShowDownloadBtn) {
        
        _downloadBtnW.constant = 50;
    } else {
        
        _downloadBtnW.constant = 0;
    }
}

- (void)setIsShowZhuanfaBtn:(BOOL)isShowZhuanfaBtn {
    _isShowZhuanfaBtn = isShowZhuanfaBtn;
    
    if (isShowZhuanfaBtn) {
        
        _zhuanfaBtnW.constant = 50;
    } else {
        
        _zhuanfaBtnW.constant = 0;
    }
}

@end
